import request from '@/utils/request'

// 查询任务数据列表
export function listCollectionTask(query) {
  return request({
    url: '/baseinfo/collectionTask/list',
    method: 'get',
    params: query
  })
}

// 查询任务数据详细
export function getCollectionTask(id) {
  return request({
    url: '/baseinfo/collectionTask/' + id,
    method: 'get'
  })
}
export function checkTempById(id) {
  return request({
    url: '/baseinfo/collectionTask/checkTempById/' + id,
    method: 'get'
  })
}
export function findTempData(id) {
  return request({
    url: '/baseinfo/collectionTask/findTempData/' + id,
    method: 'get'
  })
}
export function stopGetTemp(id) {
  return request({
    url: '/baseinfo/collectionTask/stopGetTemp/' + id,
    method: 'get'
  })
}
export function startHeat(id) {
  return request({
    url: '/baseinfo/collectionTask/startHeat/' + id,
    method: 'get'
  })
}
export function stopHeat(id) {
  return request({
    url: '/baseinfo/collectionTask/stopHeat/' + id,
    method: 'get'
  })
}


// 查询任务数据详细
export function getInversionStatus() {
  return request({
    url: '/baseinfo/collectionTask/getInversionStatus',
    method: 'get'
  })
}
// 新增任务数据
export function addCollectionTask(data) {
  return request({
    url: '/baseinfo/collectionTask',
    method: 'post',
    data: data
  })
}

// 停止任务
export function stopTask(data) {
  return request({
    url: '/baseinfo/collectionTask/stopTask',
    method: 'post',
    data: data
  })
}
// 数据反演
export function inversionTask(data) {
  return request({
    url: '/baseinfo/collectionTask/inversion',
    method: 'post',
    data: data
  })
}
//热源法
export function heatConduction(data) {
  return request({
    url: '/baseinfo/collectionTask/heatConduction',
    method: 'post',
    data: data
  })
}

//热比较法
export function heatConductionByCompare(data){
  return request({
    url: '/baseinfo/collectionTask/heatConductionByCompare',
    method: 'post',
    data: data
  })
}


// 修改任务数据
export function updateCollectionTask(data) {
  return request({
    url: '/baseinfo/collectionTask',
    method: 'put',
    data: data
  })
}

// 删除任务数据
export function delCollectionTask(id) {
  return request({
    url: '/baseinfo/collectionTask/' + id,
    method: 'delete'
  })
}


export function taskCount() {
  return request({
    url: '/baseinfo/collectionTask/taskCount',
    method: 'get'
  })
}
//查询最近一小时温度
export function temperatureChange(query) {
  return request({
    url: '/baseinfo/temperatureData/temperatureChange',
    method: 'get',
    params: query
  })
}


//查询最近一小时陀螺仪
export function gyroscopeChange(query) {
  return request({
    url: '/baseinfo/gyroscopeData/gyroscopeChange',
    method: 'get',
    params: query
  })
}
//导出数据
export function Export(id) {
  return request({
    url: '/baseinfo/collectionTask/exportData/' + id,
    method: 'get'
  })
}
//导出温度数据
export function TempExport(id) {
  return request({
    url: '/baseinfo/collectionTask/exportTempData/' + id,
    method: 'get'
  })
}
//时域频域分析 analyse
export function analyse(data) {
  return request({
    url: '/baseinfo/collectionTask/analyse',
    method: 'post',
    data: data
  })
}
